<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/12/29
  Time: 8:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>课程计数器</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link type="text/css" href="../layui/css/layui.css" rel="stylesheet">
    <script type="text/javascript" src="../layui/layui.js"></script>

    <script type="text/javascript">
        layui.use(['layer', 'form',"table","jquery","upload"], function(){
            var layer = layui.layer
            var form = layui.form;
            var table=layui.table
            var $=layui.jquery
            var upload = layui.upload;
            table.render({
                elem:"#counter"
                ,url:"${pageContext.request.contextPath}/selectCounterByPage"
                ,toolbar:"#toolbarDemo"
                ,where: {"lessonId":${param.lessonId}}
                ,page:true
                ,cols:[[
                    {field:"counterId",title:"编号",align:"center"}
                    ,{field:"counterName",title:"计数器名字",align:"center"}
                    ,{field:"counterDate",title:"计数时间",align:"center"}
                    ,{field:"lessonId",title:"课程id",align:"center"}
                    ,{field:"userId",title:"用户id",align:"center"}
                    ,{field:"counterCount",title:"计数器内容",align:"center"}
                    ,{field:"counterStatus",title:"计数器状态",align:"center"}

                ]]
            })
            /*table.on('toolbar(counterFilter)', function(obj){
               // var checkStatus = table.checkStatus(obj.config.id);
                var name=$("#nameInput").val()
                if(obj.event=="switch"){
                    table.reload('counter', {
                        where: {"name":name} //设定异步数据接口的额外参数
                    });
                }

            });*/








        });

    </script>


    <%--<!--/*自定义头工具栏模板*/-->
    <script type="text/html" id="toolbarDemo">
        <div class="layui-inline">
            <label class="layui-form-label">名字</label>
            <div class="layui-input-inline" style="width: 200px;">
                <input type="text" placeholder="请输入名字" class="layui-input" id="nameInput">
            </div>
            <button class="layui-btn layui-btn-sm" lay-event="switch">查询</button>
        </div>
    </script>--%>
</head>
<body>
<table id="counter" lay-filter="counterFilter"></table>


</body>
</html>
